import { fetch, postWithJson, post, del, delWithJson, upload, download} from '@/utils/http'
// 获取文本TXT
export function getTxtByUri (params) {
    return fetch('/search/content', params).then(response => response.data)
}
// 获取已标注的对象
export function getListDocumentTag (params) {
    return fetch('/relation/listDocumentTag', params)
}
// 保存文本标注
export function postMarkTag (params) {
    return postWithJson('/instance/mark/tag', params)
}
// 智能识别文档地名人名机构名
export function postHanlp (params) {
    return fetch('/instance/hanlp', params).then(response => response.data)
}
// 根据对象列表获取对象树
export function findAllWithBizGroupAsMap (params) {
    return post('/object/findAllWithBizGroupAsMap', params).then(res => res.data)
}
// 获取相关属性
export function getAssociationAttr (params) {
    return fetch('/search/detail', params).then(res => res.data)
}
// 获取关联信息
export function getRelationInfo (params) {
    return fetch('/path/relation/social/account', params)
}
// 获取相关信息
export function getAssociationInfo (params) {
    return postWithJson('/path/relation/filter/listRelation', params)
}
// 保存属性
export function saveProperty (params) {
    return postWithJson('/instance/property/save', params)
}
// 修改属性
export function updateProperty (params) {
    return postWithJson('/instance/property/update', params)
}
// 删除属性
export function deleteProperty (params) {
    return postWithJson('/instance/property/remove', params)
}
// 获取日志列表
export function getLogList (params) {
    return fetch('/log/object/list', params).then(res => res.data)
}
// 撤销日志
export function revokeLog (params) {
    return fetch('/log/object/callback', params)
}
// 获取可操作的属性
export function findOperateProperties (params) {
    return fetch('/ontology/findOperateProperties', params).then(res => res.data)
}
// 获取对象树
export function getsubscribeTree () {
    return fetch('/subscribegroup/tree')
}
// 添加订阅实例
export function addGroup (params) {
    return postWithJson('/subscribegroup/addInstance', params)
}
// 获取所有标签
export function getAllTags () {
    return fetch('/tag/findAll')
}
// 获取当前用户所拥有的标签
export function getOwnerTags (params) {
    return fetch('/social/tags/list', params)
}
// 删除用户拥有的标签
export function deleteOwnerTag (params) {
    return del('/social/tags/delete?rowkey=' + params.rowkey + '&tag=' + params.tag + '&objecturi=' + params.objecturi)
}
// 删除全局标签
export function delTags (id) {
    return del('/tag/delete/' + id)
}
// 获取发帖统计数据
export function getPostingStatisticsData (params) {
    return postWithJson('/social/post/group/statistics', params)
}
// 获取相关经历
export function getExperienceInfo (params) {
    return fetch('/social/list/experience', params)
}
// 添加或修改标签
export function tagsSaveOrUpdate (params) {
    return post('/tag/saveOrUpdate', params)
}
// 保存监控实例
export function saveMonitoringInstance (params) {
    return postWithJson('/monitoring/save', params)
}
// 根据rowkey删除监控实例
export function deleteMonitor (params) {
    return delWithJson('/monitoring/deleteByRowkey', params)
}
// 给对象添加标签
export function tagsSave (params) {
    return postWithJson('/social/tags/save', params)
}
export function getSocialAnalysisDetail (param) {
    return fetch('/relation/statistical/showDetail', param)
}
// 获取社交数量统计信息
export function getSocialAnalysisCount (param) {
    return fetch('/relation/statistical/show', param)
}
// 获取文章列表
export function getArticleList (param) {
    return postWithJson('/social/relation/post/list', param)
}
// 获取文章列表数量
export function getArticleListCount (param) {
    return postWithJson('/social/relation/post/count', param)
}
// 文件上传
export function uploadFile (formData) {
    return upload('/file/upload', formData)
}
// 保存一个新的属性，并关联到参数objectUri对象下
export function savePropertyToObject (params) {
    return postWithJson('/ontology/savePropertyAndRelate2Object', params)
}
// 获取属性类别
export function getPropertytype () {
    return fetch('/enum/propertytype')
}
// 新给两个对象关联一条已存在的关系
export function relate2Objects (params) {
    return post('/ontology/relate2Objects', params)
}
// 保存实例
export function saveInstance (params) {
    return postWithJson('/instance/save', params)
}
export function saveEdge (params) {
    return postWithJson('/relation/saveEdge', params)
}
// 全文检索列表
export function searchFullTextList (params) {
    return postWithJson('/search/listFullText', params).then(res => res.data)
}
// 获取可选关系
export function getOperateLinks (params) {
    return fetch('/ontology/findOperateLinks', params)
}
export function fileDownLoad (rowkey, objectUri) {
    return download(`/file/${rowkey}/${objectUri}/download`)
}
// 保存或者修改SubscribeGroup
export function saveOrUpdateSubscribeGroup (params) {
    return post('/subscribegroup/saveOrUpdate', params)
}
// 根据groupid删除SubscribeGroup
export function deleteSubscribeGroup (id) {
    return del('/subscribegroup/delete/' + id)
}
